#include <stdio.h>

// 1. 自定义了一种结构体类型，叫student
struct student
{
    unsigned ID;
    int age;
    char *name;
    float score;
}Bill, Mike; // 全局变量

void showInfo2( struct student *p );
void showInfo1(struct student someone);

int main(int argc, char const *argv[])
{
    // 普通类型本身自带，可以直接定义变量
    int a, c;
    float b;

    // 2. 使用自定义的结构体类型，去定义结构体变量
    struct student Jack;
    struct student Rose = { 002 , 21 ,  "Rose" , 90.5 }; // 传统初始化
    struct student Michael = {
                                .score = 80,
                                .age = 22,
                                .name = "Michael"
                             };
    
    showInfo1(Michael);
    showInfo2(&Rose);

    struct student GZ2433[100] = {  {001, 21, "zhangsan" , 90.3} };
    GZ2433[1] = Michael;
    GZ2433[2] = Rose;

    return 0;
}

void showInfo2( struct student *p )
{
    printf("%s: 年龄[%d], 分数[%f]\n", (*p).name, (*p).age, p->score );
}

void showInfo1(struct student someone)
{
    printf("%s: 年龄[%d], 分数[%f]\n", someone.name, someone.age, someone.score);
}